package cn.tedu.tmall.basic.dao.persist.repository.impl;

import cn.tedu.tmall.basic.dao.persist.mapper.DistrictMapper;
import cn.tedu.tmall.basic.dao.persist.repository.IDistrictRepository;
import cn.tedu.tmall.basic.dao.repository.IDistrictCacheRepository;
import cn.tedu.tmall.basic.pojo.po.DistrictPO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.ListOperations;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Repository;

import java.io.Serializable;
import java.util.List;
@Slf4j
@Repository
public class DistrictRepositoryImpl implements IDistrictRepository {
    @Autowired
    private DistrictMapper districtMapper;
    @Autowired
    private IDistrictCacheRepository iDistrictCacheRepository;


    public DistrictRepositoryImpl() {
        log.debug("创建存储库对象：DistrictRepositoryImpl");
    }

    @Override
    public List<DistrictPO> listByParent(Long parentId) {
        log.debug("开始执行【根据父级查询子级地区列表】的数据访问，参数：{}", parentId);
        return districtMapper.listByParent(parentId);
    }

    @Override
    public List<DistrictPO> listAll() {
        return districtMapper.listAll();
    }

    @Override
    public List<Long> listAllParentIds() {
        return districtMapper.listAllParentIds();
    }

}
